<template>
  <el-tooltip placement="top" effect="customized" v-model:visible="visible">
    <template #content>
      <span>{{ t('common.redo') }}</span>
    </template>
    <el-button text class="svg-Btn"  :loading="isRefresh" @mouseenter="visible = true" @click="
  visible = false;
isRefresh = true;
redo()
    " @mouseleave="visible = false">
      <template #icon>
        <SvgIcon icon-class="refresh" :size="20"></SvgIcon>
      </template>
    </el-button>
  </el-tooltip>
</template>

<script lang="ts" setup>
import { useI18n } from '@/hooks/web/useI18n'
import { ref } from 'vue'
import { useTableContext } from '../../hooks/useTableContext'

const isRefresh = ref(false)
const visible = ref(false)
const { t } = useI18n()
const table = useTableContext()

const redo = () => {
  table.reload().then(function (result) {
    isRefresh.value = false
    visible.value = false
  })
}
</script>

<style lang="scss">

</style>